﻿using System;
using System.Collections.Generic;
using System.Text;

namespace GIVisualEditor
{
    public delegate void PropertyChangedHandler(Position p);

    [Serializable()]
    public class Position
    {
        private int x = 0, y = 0, width = 10, height = 10;
        public event PropertyChangedHandler PositionChanged = null;

        private void BroadCast()
        {
            if (this.PositionChanged != null) PositionChanged(this);
        }

        public int Height
        {
            get { return height; }
            set { height = value; BroadCast(); }
        }

        public int Width
        {
            get { return width; }
            set { width = value; }
        }
        
        public int Top
        {
            get { return y; }
            set { y = value; }
        }

        public int Left
        {
            get { return x; }
            set { x = value; }
        }

        public Position(int l, int t, int w, int h)
        {
            x = l; y = t; width = w; height = h;
        }

        public Position()
        {
        }

    }
}
